@extends('layouts.admin')
@section('content')
    
          <section id="main-content">
          <section class="wrapper">
              <!-- page start-->
              <div class="row">
                  <div class="col-lg-12">
                      <section class="panel">
                          <header class="panel-heading">
                             用户余额<span style="color: #e56155;">[{{ $user->name }}({{ $user->mobile }})]</span>
                          </header>
                          <div class="panel-body">
                              <div class="form">
                                  <form class="cmxform form-horizontal tasi-form" id="signupForm" action="{{ route('admin.member.balance',['id'=>$user->id]) }}" method="POST">
                                     @if($errors->first())
            <div class="alert alert-danger">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <strong>{{ $errors->first() }}!</strong>
            </div>
            @endif
                      
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" for="checkbox">余额</label>
                                        <div class="col-sm-6">
                                            ￥：{{ $user->balance }}
                                            <!-- <input type="text"  data-toggle="tooltip" name="superior"
                                                   data-trigger="hover" class="form-control tooltips"
                                                   placeholder="不修改时请留空"
                                                   data-original-title="请输入上级电话号码" > -->
                                        </div>
                                    </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label">金额 <span class="asterisk">*</span></label>

                                <div class="col-sm-6">
                                    <input type="text"  data-toggle="tooltip" name="money"
                                           data-trigger="hover" class="form-control tooltips"
                                           data-original-title="请输入正确金额(正数为增加，负数为扣除)" value="{{ old('money') }}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label">备注 <span class="asterisk">*</span></label>

                                <div class="col-sm-6">
                                    <input type="text"  data-toggle="tooltip" name="note"
                                           data-trigger="hover" class="form-control tooltips"
                                           data-original-title="请输入备注" value="{{ old('note') }}">
                                </div>
                            </div>

                            
                             <input type="hidden" name="type" value="5">
                            <input type="hidden" name="_method" value="PUT">
                            {{ csrf_field() }}

                                      <!-- <div class="form-group ">
                                          <label for="firstname" class="control-label col-lg-2">Firstname</label>
                                          <div class="col-lg-10">
                                              <input class=" form-control" id="firstname" name="firstname" type="text" />
                                          </div>
                                      </div> -->
                                      
                                      <div class="form-group">
                                          <div class="col-lg-offset-5 col-lg-10">
                                              <button class="btn btn-danger" type="submit">确定</button>
                                              <!-- <button class="btn btn-default" type="button">Cancel</button> -->
                                          </div>
                                      </div>
                                  </form>
                              </div>

                          <!-- table -->
                          <div class="panel-body">
                          <!-- <header class="panel-heading">
                             资金明细
                          </header> -->
                          <table class="table table-striped table-advance table-hover">
                              <thead>
                              <tr>
                                   <!-- <th>
                                        <span class="ckbox ckbox-primary">
                                            <input type="checkbox" id="selectall"/>
                                            <label for="selectall"></label>
                                        </span>
                                    </th> -->
                                    <th>ID</th>
                                    <th>用户</th>
                                    <th>金额</th>
                                    <th>余额</th>
                                    <th>类型</th>
                                    <th>备注</th>
                                    <th>创建时间</th>
                                    <!-- <th>操作</th> -->
                                  <!-- <th><i class="icon-bullhorn"></i> Company</th>
                                  <th class="hidden-phone"><i class="icon-question-sign"></i> Descrition</th>
                                  <th><i class="icon-bookmark"></i> Profit</th>
                                  <th><i class=" icon-edit"></i> Status</th>
                                  <th></th> -->
                              </tr>
                              </thead>
                              <tbody>
                              <tr>
                              @foreach($financialDetails as $financialDetail)
                                    <tr>
                                       
                                        <td>{{ $financialDetail->id }}</td>
                                        <td>{{ $financialDetail->user->name }}({{ $user->mobile }})</td>
                                        <td>{{ $financialDetail->money }}</td>
                                        
                                        <td>
                                            {{ $financialDetail->balance }}
                                        </td>
                                        <td>{{ $financialDetail->typename() }}</td>
                                        <td>{{ $financialDetail->note }}</td>
                                        <td>{{ $financialDetail->created_at }}</td>
                                        
                                    </tr>
                                @endforeach
                              </tr>
                            
                        
                              </tbody>
                          </table>
                           {!! $financialDetails->render() !!}
                           </div>
                          <!-- table end-->

                          </div>
                      </section>
                  </div>
              </div>
              <!-- page end-->
          </section>
      </section>
@endsection